//
//  Singleton.h
//  TicketingSystem
//
//  Created by Conner Wu on 15/7/20.
//  Copyright (c) 2015年 Beyondsoft. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "UserModel.h"
#import <CoreLocation/CoreLocation.h>
#import "NWInitializeRequest.h"
#import "NWInitializeVersionModel.h"


#define KUserInfoDic            @"userInfoDic"
#define kSysTimeKey             @"SystemTime"
#define kQuickConsultFeeKey     @"quickConsultFee"
#define kPhoneConsultFeeKey     @"phoneConsultFee"
#define kAutoOperationDay       @"autoOperationDay"
@class MBProgressHUD;
@class FMDatabase;

@interface Singleton : NSObject


@property (nonatomic, assign) BOOL pushAlertIsShow;

@property (nonatomic ,strong) NSString *userId;

@property (nonatomic ,strong) NSString *userType;

@property (nonatomic, strong) FMDatabase *userDB;

@property (nonatomic, strong) FMDatabase *publicDB;

@property (nonatomic, assign) BOOL locationDenied;//YES  表示用户不允许定位

//@property (nonatomic, assign) NSInteger   defaultTabarIndex;

@property (nonatomic ,assign) BOOL  isLogin;//用户是否是登录状态

@property (nonatomic, assign) BOOL noRefresh;           //是否不需要刷新

@property (nonatomic, assign) CLLocationCoordinate2D location;

@property (nonatomic, strong) UILabel *tipsLabel;//显示table内容为空时的提示

@property (nonatomic, strong) NSString *sysTime;//后台系统时间

//@property (nonatomic, strong) NWInitializeCityModel *currentCity;//与后台配对

@property (nonatomic, strong) NSString * currentCityName;//定位到的城市名称 若此属性有值，currentCity无值，则表示不支持的地区


+ (instancetype)shareInstance;

- (void)startLoading;

- (void)startLoadingInView:(UIView *)view;

- (void)stopLoading;

- (void)checkPublicDatabase;

- (void)checkUserDatabase;

- (void)initializeApp:(void(^)(BOOL,NWInitializeVersionModel *,BOOL))completeBlock; //获取更新数据   1，bool表示成功，2，bool表示第一次初始化失败

- (void)startLocationService;

+ (NSString* )getFilePath;

@end
